<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .d1{
            width: 200px;
            height: 300px;
            background-color: red;
            float: left;
            margin-right: 10px;
        }
        .d2{
            height: 300px;
            background-color: blue;
            /* 创建bfc */
            overflow: hidden;
        }

        .left,.right{
            width: 200px;
            height: 100px;
            background: green;
            float: left;
        }
        .right{
            float: right;
        }
        .main{
            height: 100px;
            background: red;
            /* 创建bfc */
            overflow: hidden;
        }

        .d3{
            width: 100px;
            height: 100px;
            background: pink;
            float: left;
        }
        .d4{
            width: 200px;
            height: 200px;
            background: green;
            /* 创建bfc */
            overflow: hidden;
        }
    </style>
</head>
<body>
    <!-- 
        特性2：bfc区域不会与float的元素区域重叠
     -->
    <!-- 实现功能1：两栏布局，左边固定宽度，右边不设置，因此右边的宽度自适应，根据浏览器窗口大小而变化 -->
    <div class="d1"></div>
    <div class="d2"></div>
    <hr>

    <!-- 实现功能2：三栏布局，左右两边固定宽度，中间不设置，因此中间的宽度自适应，根据浏览器窗口大小而变化 -->
    <div>
        <div class="left"></div>
        <div class="right"></div>
        <div class="main"></div>
    </div>
    <hr>

    <!-- 实现功能3：浮动的盒子会遮盖下面的盒子 -->
    <div class="d3">333</div>
    <div class="d4">4sdf sadas asd sd sdaf wer wer we we we wer we  ew we qwe wqe weqr 23 324 </div>


</body>
</html>